package com.ysm.smfu.bean;

import com.ysm.smfu.utils.PinYinUtils;

import java.io.Serializable;

/**
 * Created by Administrator on 2016/9/23.
 */
public class City implements Comparable<City>,Serializable {
    public String id;
    public String name;
    public String pinyin;

    public City(String name,String id) {
        this.id=id;
        this.name = name;
        this.pinyin = PinYinUtils.getPinYin(name);
    }
    @Override
    public int compareTo(City another) {
        // > 0  =0   < 0
        return this.pinyin.compareTo(another.pinyin);
    }

}
